package com.wx.redis.test.send;


import com.wx.redis.mq.SendMqService;
import com.wx.redis.mq.BizEnum;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author weixin 2024/11/20 16:20
 */
@RestController
@RequestMapping("test/send")
public class TestSendMq {

    @Resource
    private SendMqService sendMqService;

    @GetMapping(value = "biz")
    public String send(){
        A a = new A();
        a.setId(1L);
        a.setName("张三");
        a.setCode("ssss");
        sendMqService.send(BizEnum.biz_a_add,a);

        A a1 = new A();
        a1.setId(2L);
        a1.setName("李四");
        a1.setCode("bbbbb");
        sendMqService.send(BizEnum.biz_b_add,a1);

        return "ok";
    }
}
